﻿@namespace Aspire.Dashboard.Components
@using Aspire.Dashboard.Model
@using Microsoft.FluentUI.AspNetCore.Components

@foreach (var highlightedCommand in Commands.Where(c => c.IsHighlighted))
{
    <FluentButton Appearance="Appearance.Lightweight" Title="@(highlightedCommand.DisplayDescription ?? highlightedCommand.DisplayName)" OnClick="@(() => CommandSelected.InvokeAsync(highlightedCommand))">
        @if (!string.IsNullOrEmpty(highlightedCommand.IconName) && CommandViewModel.ResolveIconName(highlightedCommand.IconName) is { } icon)
        {
            <FluentIcon Value="icon" />
        }
        else
        {
            @highlightedCommand.DisplayName
        }
    </FluentButton>
}

<AspireMenuButton
    ButtonAppearance="Appearance.Lightweight"
    Icon="@(new Icons.Regular.Size24.MoreHorizontal())"
    Items="@_menuItems"
    @ref="_menuButton" />
